-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add table summarizing sampler properties and processing #871
Add table summarizing sampler properties and processing #871
Conversation
LGTM - although, at least in Java, |
specification/trace/sdk.md
Outdated
trace events can be avoided. [Span Processors](#span-processor) will receive | ||
all spans with this flag set. However, [Span Exporter](#span-exporter) will | ||
not receive them unless the `Sampled` flag was set. | ||
* `IsRecording` field of a `Span`. If `true` the current `Span` records tracing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `IsRecording` field of a `Span`. If `true` the current `Span` records tracing | |
* `IsRecording` field of a `Span`. If `true` the current `Span` records in memory tracing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "in memory data"? I think the current wording (== the old wording) is more clear here. What would be more clear IMHO would be:
* `IsRecording` field of a `Span`. If `true` the current `Span` records tracing | |
* `IsRecording` field of a `Span`. If `false` the current `Span` discards all tracing |
and remove the "otherwise ...".
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
processing. | ||
specification](https://www.w3.org/TR/trace-context/#sampled-flag). This flag indicates that the `Span` has been | ||
`sampled` and will be exported. [Span Exporters](#span-exporter) MUST | ||
receive those spans which have `Sampled` flag set to true and they SHOULD NOT receive the ones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the text here is "SHOULD NOT" - it means the recommendation is to not call Exporters for Spans without Sampled
flag set. Processors could still do it, and spec is not prohibiting it.
As we used "SHOULD NOT" here, do we still require additional explicit clarification here, or in the table that "Depending on the Processor, Exporter may still get span without Sampled
flag set? @carlosalberto @Oberon00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary but it would be nice. If you want, you can add a sentence to the built in span processors section that they MUST NOT call exporters for unsampled spans (unless explicitly requested).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me address that as a follow up PR. I fear adding it might delay this PRs progress.
(Meanwhile I'll to figure out under what scenarios a user want to sent unsampled spans to exporter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, is IsRecording
something that can be explicitly set by the user/instrumentations? I don't see anywhere in the API that actually gives the ability to change it. It doesn't seem to be a "must have" in span [creation](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#span-creation either.
IsRecording is set according to the sampling decision, see the spec of |
The only place which can set the |
@Oberon00 |
It goes both ways a bit. The sampler gets the parent SpanContext, which includes the parent Sampled flag, as input and can use that to influence the Decision it returns (see ParentBased sampler). But that decision, as you said, then determines the sampled+recorded flags of the child span. |
The following table summarizes the expected behavior for each combination of | ||
`IsRecording` and `SampledFlag`. | ||
|
||
| `IsRecording` | `Sampled` Flag | Span Processor receives Span? | Span Exporter receives Span? | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the third column is a change / additional specification, but I think it's good.
@cijothomas Can you add "Fixes #782" to the PR description?
processing. | ||
specification](https://www.w3.org/TR/trace-context/#sampled-flag). This flag indicates that the `Span` has been | ||
`sampled` and will be exported. [Span Exporters](#span-exporter) MUST | ||
receive those spans which have `Sampled` flag set to true and they SHOULD NOT receive the ones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary but it would be nice. If you want, you can add a sentence to the built in span processors section that they MUST NOT call exporters for unsampled spans (unless explicitly requested).
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
@yurishkuro I made more refactoring after initial approval- So re-requested review from you. (Also saw you as the assigned owner) |
@yurishkuro Please merge. |
…ry#871) * Add table summarizing sampler properties and processing * markdownlink * event -> data to avoid confusion with Event Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> * events -> data Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> * plural Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> * use MUST Co-authored-by: Christian Neumüller <christian+github@neumueller.me> * Update specification/trace/sdk.md Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> * Update specification/trace/sdk.md Co-authored-by: Christian Neumüller <christian+github@neumueller.me> * reword * spacing * more links fix * markdownl * Update specification/trace/sdk.md Co-authored-by: Christian Neumüller <christian+github@neumueller.me> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Co-authored-by: Christian Neumüller <christian+github@neumueller.me> Co-authored-by: Carlos Alberto Cortez <calberto.cortez@gmail.com>
Fixes #782
No change to existing behavior. Just clarifying when does SpanProcessor and SpanExporters get Span, based on
IsRecording
andSampled
flag, with a table to make it very obvious.Please provide a brief description of the changes here. Update the
CHANGELOG.md
for non-trivial changes.Related issues #
Related oteps #